package com.yulongtian.weekCompetition.month202303.week01;

/**
 * 第 335 场周赛
 * 可
 *
 * @author yulongTian
 * @create 2023-03-05 9:54
 */
public class Test11 {
    public static void main(String[] args) {
        System.out.println(passThePillow(3, 11));
    }

    public static int passThePillow(int n, int time) {
        //重新传到1号的时间间隔
        int all = 2 * (n - 1);
        time %= all;
        if (time <= n - 1) {
            return 1 + time;
        } else {
            return n - time % (n - 1);
        }
    }

}
